doctype
html
	head
		meta(charset="utf-8")
		title #{title}
		link(href="/css/admin.css",rel="stylesheet")
	body
		.J-login-box
			.J-logo
				.logo-bg#logo-bg
					canvas#logo-canvas.logo-canvas(style="display:none")
				.logo
					h1
						a(href="#",rel="nofollow") 俊峰
			.J-form
				.input
					input#username.in(type='text',name='username',placeholder='请输入帐号')
				.input
					input#password.in(type="password",name='password',placeholder='请输入密码')
				span#submit.submit(onclick='login()') 登录
		script(src="http://cdn.bootcss.com/jquery/2.2.0/jquery.min.js",type="text/javascript")
		script(src="/js/layer/layer.js",type="text/javascript")
		script(src="/js/Jlayer.js",type="text/javascript")
		script(src="/js/logo.js",type="text/javascript")
		script(src="/js/index.js",type="text/javascript")
		script.
			//登录框
			function login() {
				var username = $('#username').val();
				var password = $('#password').val();
				var data = {"username": username, "password": password};
				$.ajax({
					url: '/user/signin',
					type: 'POST',
					data: data,
					success: function (data) {
						if (data.success) {
							window.location.href = "http://" + window.location.host + "/admin/main"
						} else {
							J.Msg("用户或密码有误")
						}
					}
				});
			}

